using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.ConnectionEngine.Adapters;
using common = Microsoft.ConnectionEngine.Common;

namespace Microsoft.ConnectionEngine.Registers.Health.Patient
{
    public class SystemAdapter : SystemAdapterBase
    {
        protected override System.Xml.XmlDocument AssembleMessage(object objMessage, int msgType)
        {
            try
            {
                string payloadContent = (string)objMessage;
                System.Xml.XmlDocument payloadXml = new System.Xml.XmlDocument();
                payloadXml.LoadXml(payloadContent);
                return payloadXml;
            }
            catch (Exception ex)
            {
                common.SystemAdapterException sysEx = new common.SystemAdapterException(
                    common.SystemAdapterExceptionCause.Hl7PlayloadCreation,
                    "An error occurred assembling the Xml Message.",
                    ex);
                throw sysEx;
            }
        }

    }
}
